package XComponent.show
{
	import flash.display.Sprite;

	public class XRectDot	extends Sprite
	{
		private var m_defaultColor : int = 0xFF0000;
		private var m_defaultWidth : int = 5;
		private var m_defaultHeight : int = 5;
		
		private var m_width : Number;
		private var m_height : Number;
		
		public function XRectDot(width:Number=-1,height:Number=-1)
		{
			if(width<0)
			{
				width = m_defaultWidth;
			}
			
			if(height<0)
			{
				height = m_defaultHeight;
			}
			
			this.m_width = 		width;
			this.m_height = 	height;
		}
		
		public function destory():void
		{
			this.graphics.clear();
			
			m_defaultColor =  		0;
			m_defaultWidth =  		0;
			m_defaultHeight =  		0;
			
			m_width = 				0;
			m_height = 				0;
		}
		
		public function drawDot(color:int=-1) : void
		{
			this.graphics.clear();
			
			if(color<0)
			{
				color = m_defaultColor;
			}
			
			this.graphics.beginFill(color);
			
			this.graphics.drawRect(0,0,this.m_width,this.m_height);
			
			this.graphics.endFill();
		}
		
		override public function get width():Number
		{
			return m_width;
		}
		
		override public function get height():Number
		{
			return m_height;
		}
	
	}
}